package com.teamwings.modules.head.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.teamwings.common.constant.FormConstant;
import com.teamwings.modules.head.entity.FormTableHead;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author admin
 * @since 2021-05-06
 */
public interface IFormTableHeadService extends IService<FormTableHead> {
    @Cacheable(value = FormConstant.FORM_HEAD_HEAD, key = "#id")
    FormTableHead getById(String id);

    String getTableNameById(String id);

    /**
     *
     * @param head
     * @param isGenerateCode 是否自动生成code
     * @param isOriginalName 是否使用原生的tableName
     * @return
     */
    Boolean saveMain(FormTableHead head,Boolean isGenerateCode,Boolean isOriginalName);

    void editMain(FormTableHead head);

    void copyMain(FormTableHead head);

    Boolean hasTable(String tableName);

    List<FormTableHead> getLatestList();

    IPage<FormTableHead> getListWhitCode(IPage<FormTableHead> page, Wrapper<FormTableHead> queryWrapper);

}
